package com.mew.chess.core.game.qmcs.game.message;

import com.mew.chess.core.game.qmcs.game.common.QmcsSlots;
import com.mew.common.util.PbWriteUtils;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.*;

import java.util.ArrayList;
import java.util.List;


@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class QmcsKillResponseMessage extends ZebraBaseMessage<QmcsKillResponseMessage> {

    private int seatNo;
    private int fishId; //鱼ID
    private int betId; //鱼ID
    private int  bulletId; //子弹ID；
    private long goldNumber; //背包金币
    private long winNumber; // 赢金币
    private int maxMultiple; // 最大倍数
    private int bounsType;
    private int freeBetId = -1;
    private int freeTimes;
    private List<QmcsSlots> slots = new ArrayList<>();

    private int fishType;
    @Override
    public void write(ByteBuf b) {

        PbWriteUtils.attr2byte(this,b);
        writeInt(b,slots.size());
        for (QmcsSlots slot : slots) {
            slot.write(b);
        }

    }

    @Override
    public QmcsKillResponseMessage read(ByteBuf b) {
        QmcsKillResponseMessage message = new QmcsKillResponseMessage();
        message.fishId = readInt(b);
        return message;
    }

}
